package com.yesjava.springbootjpa.demo.dao;

import com.yesjava.springbootjpa.demo.entity.Category;
import com.yesjava.springbootjpa.demo.entity.Goods;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

/*@Component
@Controller
@Service*/
@Repository
public interface GoodsDao extends JpaRepository<Goods,Integer> {
    public Page<Goods> getGoodsByCategoryIn(List<Category> categories,Pageable pageable);


}


/*    List<Goods>   getGoodsByPriceBetween(double a, double b);
    @Query(" select g from Goods g where g.price between ?1 and ?2 ")
    List<Goods>  mygetGoodsByPriceBetween(double a, double b);*/
